********************************************************************************************
*** TABLE A11: Effect of Appropriations Committee Report about Improper Payments on IP Rate.
********************************************************************************************
			
use "$DATALOC/AgencyLevel.dta", clear
* Report
eststo app_reports_a1: reghdfe iprate report,  a(agency FY)
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
* Report, direct mention of agency
eststo app_reports_a2: reghdfe iprate report_ip2,  a(agency FY)
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
* Report, first time
eststo app_reports_a5: reghdfe iprate report reportXfirst report_first,  a(agency FY)
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
*Report, direct mention of agency, first time
eststo app_reports_a6: reghdfe iprate report_ip2 report_ip2Xfirst report_ip2_first,  a(agency FY)
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
* Report, t-1
eststo app_reports_a3: reghdfe iprate report report_lag1,  a(agency FY)
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
* Report, direct mention of agency, t-1
eststo app_reports_a4: reghdfe iprate report_ip2 report_ip2_lag1,  a(agency FY)
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace

use "$DATALOC/ProgramLevel.dta", clear	
* Report
eststo app_reports_p1: reghdfe iprate report,  a(programname FY) $CLUSTERCODE
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
	estadd ysumm, replace	
* Report, direct mention of agency
eststo app_reports_p2: reghdfe iprate report_ip2,  a(programname FY) $CLUSTERCODE
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
	estadd ysumm, replace	
* Report, t-1
eststo app_reports_p3: reghdfe iprate report report_lag1,  a(programname FY) $CLUSTERCODE
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
	estadd ysumm, replace
* Report, direct mention of agency, t-1
eststo app_reports_p4: reghdfe iprate report_ip2 report_ip2_lag1,  a(programname FY) $CLUSTERCODE
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
	estadd ysumm, replace	
* Report, first time
eststo app_reports_p5: reghdfe iprate report reportXfirst report_first,  a(programname FY) $CLUSTERCODE
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
	estadd ysumm, replace	
* Report, direct mention of agency, first time
eststo app_reports_p6: reghdfe iprate report_ip2 report_ip2Xfirst report_ip2_first,  a(programname FY) $CLUSTERCODE
	quietly estadd local fixedyear "Yes", replace
	quietly estadd local fixedagency "Yes", replace
	estadd ysumm, replace	
	
	
*** OUTPUT TABLE	
esttab app_reports_a2 app_reports_a4 app_reports_a6 app_reports_a1 app_reports_a3 app_reports_a5 app_reports_p2 app_reports_p4 app_reports_p6 app_reports_p1 app_reports_p3 app_reports_p5 using "$TABLELOC/TableA11.tex", ///
	prehead("\begin{sidewaystable}[htbp]\centering \def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi} \caption{Effect of Appropriations Committee Report about Improper Payments on Improper Payment Rate.} \resizebox{\textwidth}{!}{ \begin{tabular}{l*{13}{c}} \toprule") ///
	b(a2) fragment ///
	booktabs label se star(** 0.05 *** 0.01)s(fixedyear fixedagency N, label("Fiscal Year FE" "Agency/Program FE" "Observations")) ///
	order(report_ip2 report_ip2_lag1 report_ip2Xfirst report report_lag1 reportXfirst) keep(report_ip2 report_ip2_lag1 report report_lag1 report_ip2Xfirst reportXfirst) ///
	nomtitles ///
	mgroups("Agency-level" "Program-level", ///
				pattern(1 0 0 0 0 0 1 0 0 0) ///
				span prefix(\multicolumn{@span}{l}{) suffix(})) ///
	prefoot("\hline") ///
	postfoot("\bottomrule \multicolumn{8}{l}{\footnotesize Standard errors in parentheses; clustered on agency-year for program-level analysis.}\\ \multicolumn{4}{l}{\footnotesize \sym{**} \(p<0.05\), \sym{***} \(p<0.01\)}\\ \end{tabular} } \\ \label{tab:reports} \end{sidewaystable}") replace
		
